﻿/**
 * Author: Junaid P V
 * License: New BSD License
 **/
using System;
using System.Collections.Generic;

namespace Org.AI.Neural
{
    /// <summary>
    /// Represent an input connection to a neuron
    /// </summary>
    public class NeuronConnection
    {
        /// <summary>
        /// Input value through this connection
        /// </summary>
        private double input;

        /// <summary>
        /// Weight of the connection.
        /// </summary>
        private double weight;

        /// <summary>
        /// Neuron whose output is fedding to this neuron.
        /// </summary>
        private Neuron neuron;

        /// <summary>
        /// Simple constructor, does nothing.
        /// </summary>
        public NeuronConnection()
        {

        }

        /// <summary>
        /// Create a connection object with neuron where
        /// connection starts
        /// </summary>
        /// <param name="neuron"></param>
        public NeuronConnection(Neuron neuron)
        {
            this.neuron = neuron;
        }

        /// <summary>
        /// Get or set input value the connection.
        /// </summary>
        public double Input
        {
            get { return this.input; }
            set { this.input = value; }
        }

        /// <summary>
        /// Get or set weight of the connection.
        /// </summary>
        public double Weight
        {
            get { return this.weight; }
            set { this.weight = value; }
        }

        /// <summary>
        /// Get or set the connection originating neuron.
        /// </summary>
        public Neuron Neuron
        {
            get { return this.neuron; }
            set { this.neuron = value; }
        }
    }
}
